#ifndef CCLOCK_H_HEADER_INCLUDED_B8A38104
#define CCLOCK_H_HEADER_INCLUDED_B8A38104
#include "GUI.h"
#include "StaticImg.h"



// some definitions

#define SECOND_HAND_LENGTH	35.0
#define MINUTE_HAND_LENGTH	39.0
#define HOUR_HAND_LENGTH	28.0

#define SECOND_HAND_COLOR	RGB(220,20,60)
#define MINUTE_HAND_COLOR	RGB(0,0,0)
#define HOUR_HAND_COLOR		RGB(0,0,0)
#define PI					3.1415926535

class GUI_API CAnaLogClock : public StaticImg
{


	HBITMAP h_MemBmp;
	HDC  h_MemDc;
	HBRUSH m_hBrush;
	COLORREF	m_rgbBackground;
	COLORREF	m_rgbTransparent;
	COLORREF	m_rgbSecondHand;
	COLORREF	m_rgbMinuteHand;
	COLORREF	m_rgbHourHand;

public:

	virtual void acceptVisitor(IVisitor ** visitor);

	CAnaLogClock(const WCHAR * szBmpName,RECT rct,const WCHAR * name);
	virtual ~CAnaLogClock();
	virtual void draw(HDC * hdc);
	void GetTime();
	int GetHour();
	int GetMinute();
	int GetSecond();
    float ConvertToDegrees(float dTime);
	void PaintMinuteAndHourHands(HDC  hdc);
	void PaintSecondHand(HDC  hdc);
	SYSTEMTIME m_systime;
};

#endif 